<div class="dbx-group" id="sidebar">
{% for widget in widgets %}
	{% ifequal widget.0 "categories" %}
	<div id="categories" class="dbx-box">
		<h3 class="dbx-handle">分类</h3>
        <div class="dbx-content"><ul>
		{% for cat in widget.1 %}
			<li><a href="/category/{{ cat.category_url }}/">{{cat.category_name}}</a></li>
		{% endfor %}
		</ul></div></div>
	{% endifequal %}
	{% ifequal widget.0 "pages" %}
	<div id="pages" class="dbx-box">
		<h3 class="dbx-handle">页面</h3>
		<div class="dbx-content"><ul>
		{% for page in widget.1 %}
			<li><a href="/page/{{page.permalink}}.html">{{page.title}}</a></li>
		{% endfor %}
		</ul></div></div>
	{% endifequal %}
	{% ifequal widget.0 "archives" %}
	<div id="archives" class="dbx-box">
		<h3 class="dbx-handle">日期</h3>
		<div class="dbx-content"><ul>
		{% for arc in widget.1 %}
			<li><a href="/archive/{{ arc.yearmonth }}/">{{ arc.yearmonth }}({{arc.entrycount}})</a></li>
		{% endfor %}
		</ul></div></div>
	{% endifequal %}
	{% ifequal widget.0 "tags" %}
	<div id="archives" class="dbx-box">
		<h3 class="dbx-handle">标签</h3>
		<div class="dbx-content"><ul>
		{% for tag in widget.1|limitnum:5 %}
			<li><a href="/tag/{{tag.tag}}/">{{tag.tag}}</a></li>
		{% endfor %}
		</ul></div></div>
	{% endifequal %}
	{% ifequal widget.0 "links" %}
	<div id="recommendLinks" class="dbx-box">
		<h3 class="dbx-handle">链接</h3>
		<div class="dbx-content"><ul>
		{% for link in widget.1 %}
			<li><a href="{{link.link}}">{{link.name}}</a></li>
		{% endfor %}
		</ul></div></div>
	{% endifequal %}
	{% ifequal widget.0 "recentcomments" %}
	<div id="recent-comments" class="dbx-box">
		<h3 class="dbx-handle">最新评论</h3>
		<div class="dbx-content"><ul>
		{% for comment in widget.1|limitnum:5 %}
            <li>{{comment.author}}:<a href="/post/{{comment.permalink}}.html">{{comment.text}}</a></li>
		{% endfor %}
		</ul></div></div>
	{% endifequal %}
	{% ifequal widget.0 "feed" %}
	<div id="feed" class="dbx-box">
		<h3 class="dbx-handle">FEED</h3>
		<div class="dbx-content"><ul>
		{% for feed in widget.1 %}
            <a href="{{ feed.link }}"><img border="0" src="{{ feed.link_autor }}" alt="{{ feed.link_alt }}" vspace="2" style="margin-bottom:3px" /></a>
            <br/>
		{% endfor %}
		</ul></div></div>
	{% endifequal %}	
	{% ifequal widget.0 "widget" %}
	<div id="{{ widget.1.key }}" class="dbx-box">
		<h3 class="dbx-handle">{{ widget.1.title }}</h3>
		<div class="dbx-content"><ul>
		{{widget.1.text}}
		</ul></div></div>
	{% endifequal %}	
{% endfor %}
</div>